package com.roadjava.tutor.bean.dto;

import com.roadjava.tutor.bean.entity.Member;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * 会员/管理员
 * @author zhaodaowen
 * @see <a href="http://www.roadjava.com">乐之者java</a>
 */
@Data
public class UserDTO extends BaseDTO{
    /**
     * 主键
     */
    private Long id;
    /**
     * 用户名
     */
    private String userName;
    /**
     * 密码
     */
    private String pwd;
    /**
     * 地址
     */
    private String addr;
    /**
     * 电话
     */
    private String phone;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 角色
     */
    private String role;
    /**
     * 客户端登录ip
     */
    private String ip;
    /**
     * 用户状态
     * @see com.roadjava.tutor.bean.enums.MemberStatusEnum
     */
    private String status;

    public Member toMember(){
        Member member = new Member();
        BeanUtils.copyProperties(this,member);
        return member;
    }

}
